
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
/*
 * Exemple d'utilisation
 * JOptionPanePerso op = new JOptionPanePerso();
 *       int i = op.result;
 */
public class JOptionPanePerso {
    public int result;

    public  JOptionPanePerso(){

        UIManager.put("OptionPane.cancelButtonText", "Annuler");
        UIManager.put("OptionPane.noButtonText", "Non");
        UIManager.put("OptionPane.okButtonText", "D'accord");
        UIManager.put("OptionPane.yesButtonText", "Oui");

         result = JOptionPane.showConfirmDialog(new JFrame(),
                "Est-ce que vous voulez continuer?", "Choisisez une option",
                JOptionPane.YES_NO_CANCEL_OPTION);
        /*if (result == JOptionPane.YES_OPTION) {
            System.out.println("Yes");
        } else if (result == JOptionPane.NO_OPTION) {
            System.out.println("No");
        } else if (result == JOptionPane.CANCEL_OPTION) {
            System.out.println("Cancel");
        } else if (result == JOptionPane.CLOSED_OPTION) {
            System.out.println("Closed");
        }
        * 
        */
    }
}
